<form action="" class="form-horizontal" data-toggle="validator" id="edit-form" method="POST" role="form">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Pid')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[pid]', $pidList, $row['pid'], ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'required'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" id="c-name" name="row[name]" type="text" data-rule="required" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Factor')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" id="c-factor" min="0" name="row[factor]" data-rule="required" type="number"
                   value="{$row.factor|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Unit')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" id="c-unit" name="row[unit]" type="text" data-rule="required" value="{$row.unit|htmlentities}">
        </div>
    </div>
    {if $row.pid == 0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                {foreach name="typeList" item="vo" key="key"}
                <label>
                    <input data-rule="required" type="radio" name="row[type]" value="{$key}" {if condition="$row['type'] eq $key"}checked="checked"{/if}>
                    {$vo}
                </label>
                {/foreach}
            </div>
        </div>
    </div>
    {/if}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button class="btn btn-primary btn-embossed disabled" type="submit">{:__('OK')}</button>
        </div>
    </div>
</form>
